﻿using System;
using System.Drawing;
using CloudShot.Utils.Drawings;

namespace CloudShot.Editor.CanvasFigures
{
  public class HighlightRectangle : CanvasObject
  {
    public Rectangle Rectangle { get; set; }

    public override void Draw(Graphics graphics) {}

    public override void DrawMarkup(Graphics graphics, Rectangle[] screens)
    {
      if (Rectangle == Rectangle.Empty)
        return;

      using (var pen = new Pen(BorderColor, BorderWidth))
      {
        Rectangle highlightRect = Rectangle;
        highlightRect.Inflate(-4, -4);
        graphics.DrawRoundedRectangle(pen, highlightRect, 4);

        ////for debug
        //graphics.DrawString(string.Format("{0}x{1}", Rectangle.Width, Rectangle.Height), 
        //  new Font(FontFamily.GenericMonospace, 12, FontStyle.Bold), 
        //  Brushes.Red, Rectangle.Location);
      }
    }

    public override Rectangle GetBoundingBox()
    {
      return Rectangle;
    }

    protected override CanvasObject CloneIntrenal()
    {
      throw new NotImplementedException();
    }
  }
}